/*
 * 练习14：用多种方法比较两个字符串是否相等。
 */

package chapter3_Operators;
import publicLibs.p;

public class E14_CompareTwoStrings {
	
	public static void compareStrings1(String s1, String s2){
		p.p( "Compare two Strings " + s1 +" " +s2);
		p.pNoln("Compare form in \"==\" ");
		p.p( s1==s2 );
		
		p.pNoln("Compare form in \"!=\" ");
		p.p( s1!=s2 );
		
		p.pNoln("Compare form in \"s1.equals(s2)\" ");
		p.p( s1.equals( s2 ));
		p.p("");
	}
	
	public static void main(String[] args) {
		String ss1 = "HelloWorld";
		String ss2 = "helloworld";
		compareStrings1(ss1, ss2);
		ss1 = "helloworld";
		compareStrings1(ss1, ss2);
		ss1 = ss2;
		compareStrings1(ss1, ss2);
	}

}
